library(tidyr)
library(dplyr)
library(ggplot2)

Data summary

summary(df)
##         country          year          sex           child        
##  Afghanistan:  38   1995   : 200   female:1900   Min.   :    0.0  
##  Algeria    :  38   1996   : 200   male  :1900   1st Qu.:   15.0  
##  Angola     :  38   1997   : 200                 Median :   57.0  
##  Argentina  :  38   1998   : 200                 Mean   :  441.8  
##  Azerbaijan :  38   1999   : 200                 3rd Qu.:  233.2  
##  Bangladesh :  38   2000   : 200                 Max.   :25661.0  
##  (Other)    :3572   (Other):2600                                  
##      adult             elderly        
##  Min.   :     0.0   Min.   :     0.0  
##  1st Qu.:   814.5   1st Qu.:    51.0  
##  Median :  2120.0   Median :   184.0  
##  Mean   :  9683.1   Mean   :  1116.9  
##  3rd Qu.:  5723.2   3rd Qu.:   556.2  
##  Max.   :731540.0   Max.   :125991.0  
## 

Number of cases per sex

knitr::kable(
df %>% 
  rowwise() %>% mutate(total = sum(child, adult, elderly)) %>%
  group_by(sex) %>% summarize(total_sum=sum(total), .groups = 'drop')
)
sex total_sum
female 15656162
male 27062807

Number of cases per age per year

by_age_and_year <- df %>% group_by(year) %>%
  summarize(child=sum(child), adult=sum(adult), elderly=sum(elderly), .groups = 'drop')
ggplot(by_age_and_year, aes(year, group=1)) + 
  geom_line(aes(y=child, colour="child")) + 
  geom_line(aes(y=adult, colour="adult")) +
  geom_line(aes(y=elderly, colour="elderly")) + 
  labs(x = "Year", y = "Cases", color = "Legend")

Number of cases per age per year for each country